import { LocalizationContext, MenuItem } from "../../core";

import DownloadIcon from "./DownloadIcon";
import { FC, useContext } from "react";

export interface DownloadMenuItemProps {
  onClick(): void;
}

const DownloadMenuItem: FC<DownloadMenuItemProps> = ({ onClick }) => {
  const l10n = useContext(LocalizationContext);
  const label = l10n && l10n.download ? l10n.download.download : "Download";

  return (
    <MenuItem icon={<DownloadIcon />} onClick={onClick}>
      {label}
    </MenuItem>
  );
};

export default DownloadMenuItem;
